﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace MySkiPatrolEntity
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IArticles" in both code and config file together.
    [ServiceContract]
    public interface IArticle
    {
        [OperationContract]
        ArticleList GetArticles(ArticleRequest data);

        [OperationContract]
        Article GetArticle(Article data);

        [OperationContract]
        Article PutArticle(Article data);
    }

    [DataContract]
    public class ArticleRequest
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }
        [DataMember]
        public string PageName { get; set; }
        [DataMember]
        public bool Public { get; set; }
    }

    [DataContract]
    public class ArticleList
    {
        [DataMember]
        public List<Article> Articles { get; set; }

        [DataMember]
        public DataTransaction DataTransaction { get; set; }
    }

    [DataContract]
    public class Article
    {
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Title { get; set; }
        [DataMember]
        public string Body { get; set; }
        [DataMember]
        public DateTime EffectiveDate { get; set; }
        [DataMember]
        public DateTime ExpiryDate { get; set; }
        [DataMember]
        public bool IsPublic { get; set; }

        //TODO: We could create a ComplexType for this attribute and provide the email criteria
        [DataMember]
        public bool SendEmailBroadcast { get; set; }

        [DataMember]
        public DataTransaction DataTransaction { get; set; }
    }
}
